Passed
Push — master ( 12291e...74547d )
by Christofer
01:04
created

Queen.js ➔ ???   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
c 2
b 0
f 0
nc 1
nop 1
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 1
rs 9.4285
1
/**
2
 * Queen module
3
 * @module
4
 */
5
"use strict";
6
7
/**
8
 * Class with Queen logic
9
 */
10
class Queen {
11
    /**
12
     * init
13
     */
14
    constructor(color) {
15 2
        this.symbol = "Q";
16 2
        this.moved = 0;
17 2
        this.active = true;
18 2
        this.color = color;
19
    }
20
21
    legalMove(x, y, nx, ny) {
22 6
        if (x == nx && y !== ny || x !== nx && y == ny) {
23
            return true
24
        }
25
26
        return false;
27
    }
28
}
29
30
31
module.exports = Queen;
32